<template>
	<view>
		<view class="list-cell b-b " @click="app.goPage('/pagesUser/pages/pay_pwd/pay_pwd?type=7?from='+from)" hover-class="cell-hover"
			:hover-stay-time="50">
			<view class="smll" >
				<u-icon name="/static/img/user/personal_icon_safe.png" class="mr20" size="48"></u-icon>
				<text class="cell-tit">帐户安全</text>
			</view>
			<view class="cell-more">修改密码<u-icon name="arrow-right ml20" :size="20"></u-icon>
			</view>
		</view>
		<view class="list-cell" @click="app.goPage('/pagesUser/pages/pay_pwd/pay_pwd?type=1?from='+from)" hover-class="cell-hover"
			:hover-stay-time="50">
			<view class="smll">
				<u-icon name="/static/img/user/personal_icon_safe.png" class="mr20" size="48"></u-icon>
				<text class="cell-tit">支付密码</text>
			</view>
			<view class="cell-more">去设置<u-icon name="arrow-right ml20"
					:size="20"></u-icon>
			</view>
			<!-- <view class="cell-more" v-if="userInfo.is_has_paypwd == 0">未设置<u-icon name="arrow-right ml20"
					:size="20"></u-icon>
			</view>
			<view class="cell-more" v-if="userInfo.is_has_paypwd == 1">已设置<u-icon name="arrow-right ml20"
					:size="20"></u-icon>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				// userInfo: {},
				from: ''
			}
		},
		onLoad(options) {
			// this.getUserInfo();
			this.from = options.from;
		},
		methods:{
			getUserInfo() {
				//获取登录会员信息
				this.$u.api.getUserInfo().then(res => {
					this.userInfo = res.data;
			
					//获取本地缓存的账号
					let syncUserInfo = uni.getStorageSync('user_account');
					if (syncUserInfo == '') {
						syncUserInfo = [];
					}
					for (let i = 0; i < syncUserInfo.length; i++) {
						if (syncUserInfo[i].mobile == this.userInfo.mobile) {
							syncUserInfo.splice(i, 1);
						}
					}
					syncUserInfo.unshift({
						token: this.app.getAuthCode(),
						mobile: this.userInfo.mobile,
						nick_name: this.userInfo.nick_name,
						avatar: this.userInfo.headimgurl
					});
					uni.setStorageSync('user_account', syncUserInfo);
				});
			},
		}
	}
</script>

<style lang="scss">
	.list-cell {
		justify-content: space-between;
	}
	.cell-tit {
		font-size: 28rpx;
	}
	.cell-more {
		font-size: 28rpx;
		color: $font-color-gray;
	}
</style>


<style lang='scss' scoped>
	.smll{
		display: flex;
		align-items: center;
	}
	.list-cell{
			display:flex;
			padding: 20rpx $page-row-spacing;
			line-height:60rpx;
			position:relative;
			background: #fff;
			justify-content: space-between;
			&.log-out-btn{
				margin-top: 40rpx;
				.cell-tit{
					color: $uni-color-primary;
					text-align: center;
					margin-right: 0;
				}
			}
			&.cell-hover{
				background:#fafafa;
			}
			
			.cell-more{
				align-self: baseline;
				font-size:$font-sm;
				color:$font-color-light;
				margin-left:10rpx;
			}
			.cell-tit{
				flex: 1;
				font-size: $font-base + 2rpx;
				color: $font-color-dark;
				margin-right:10rpx;
			}
			.cell-tip{
				font-size: $font-base;
				color: $font-color-light;
			}
			
	}
</style>